# $OpenBSD: nginx-passenger.conf.sample,v 1.5 2016/11/04 22:08:19 jeremy Exp $
#
# Example nginx.conf for Phusion Passenger
#
# Please read the official Phusion Passenger user guide for nginx.
# http://www.modrails.com/documentation/Users guide Nginx.html

user www;
worker_processes  1;
load_module "modules/ngx_http_passenger_module.so";

events {
    worker_connections  1024;
}

error_log  /var/www/logs/error.log;

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    keepalive_timeout  65;

    # The passenger root. (passenger-config --root)
    passenger_root ${PASSENGER_ROOT};

    # Some more
    passenger_log_level 1;
    passenger_ruby ${RUBY};

    server {
        listen       80;
        server_name  localhost;

        passenger_enabled on; # actually enable passenger for this vhost
        rails_env production; # set the RAILS_ENV

        # Path to the public folder of your rails app.
        root   /var/www/app/public;

        access_log  /var/www/logs/access.log  main;
    }
}
